package com.uzai.console.web.wechatwork;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.uzai.console.annotation.SystemLogType;
import com.uzai.console.dto.wechatwork.channelqrcode.WxworkChannelQrcodeIdDto;
import com.uzai.console.dto.wechatwork.channelqrcode.WxworkChannelQrcodeQuery;
import com.uzai.console.enums.OperationTypeEnum;
import com.uzai.console.enums.SystemModelEnum;
import com.uzai.console.service.device.DeviceService;
import com.uzai.console.service.wechatwork.WxworkChannelQrcodeService;
import com.uzai.console.vo.wechatwork.channelqrcode.WxworkChannelQrcodeVo;
import com.uzai.console.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 企业微信推广员
 * @author liuqi
 * @date 2021年08月16日 15:11
 */
@Api(value = "企业微信推广员",tags = "企业微信|企业微信推广员")
@ApiSort(5)
@RestController
public class WxworkChannelQrcodeController extends BaseController {
    private Logger logger = LoggerFactory.getLogger(WxworkChannelQrcodeController.class);

    @Autowired
    private WxworkChannelQrcodeService wxworkChannelQrcodeService;
    @Autowired
    private DeviceService deviceService;

    @ApiOperation(value = "分页查询企业微信推广员列表", notes = "分页查询企业微信推广员列表", response = WxworkChannelQrcodeVo.class)
    @ApiOperationSupport(order = 1)
    @PostMapping("/wxworkChannelQrcode/findByPage")
    public Object findWxworkChannelQrcodePage(@RequestBody WxworkChannelQrcodeQuery wxworkChannelQrcodeQuery){
        return wxworkChannelQrcodeService.findWxworkChannelQrcodePage(wxworkChannelQrcodeQuery);
    }

    @SystemLogType(model = SystemModelEnum.DeviceWxWorkChannelQrcode, type = OperationTypeEnum.DELETE)
    @ApiOperation(value = "删除企业微信推广员", notes = "删除企业微信推广员")
    @ApiOperationSupport(order = 2)
    @PostMapping("/wxworkChannelQrcode/delete")
    public Object wxworkChannelQrcodeService(@RequestBody WxworkChannelQrcodeIdDto wxworkChannelQrcodeIdDto){
        wxworkChannelQrcodeService.deleteWxworkChannelQrcode(wxworkChannelQrcodeIdDto);
        return true;
    }




}
